<!--recruit/item/1234 -->
<template>
    <div>
<!--两列布局--> 
  <div class="wrapper tag-item"> 
   <div class="job-intro"> 
    <div class="left-img"> 
     <img :src="item.url" alt="" /> 
    </div> 
    <div class="middle-intro"> 
     <div class="name">
      {{item.jobname}} &middot; {{enterpriseItem.name}}
     </div> 
     <div class="intro">
      {{item.salary}} / {{item.condition}} / {{item.education}}
     </div> 
     <div class="tag"> 
      <li>Python</li>
      <li>Python</li>
      <li>O2O</li>
      <li>Python</li>
      <li>Python</li> 
     </div> 
    </div> 
    <div class="right-tool"> 
     <p class="throw"><button class="sui-btn btn-throw">投简历</button></p> 
     <button class="sui-btn btn-collect">收藏</button> 
     <span>100收藏</span> 
     <span>291浏览</span> 
    </div> 
    <div style="clear:both"></div> 
   </div> 
   <div class="fl left-list "> 
    <div class="tit"> 
     <span>职位描述</span> 
    </div> 
    <div class="content"> 
        {{item.content1}}
    </div> 
    <div class="tit"> 
     <span>职位要求</span> 
    </div> 
    <div class="content"> 
        {{item.content1}}
    </div> 
    <div class="time">
     发布于1小时前
    </div> 
   </div> 
   <div class="fl right-tag"> 
    <div class="company-job"> 
     <div class="intro"> 
      <img :src="enterpriseItem.logo" alt="" /> 
      <div class="title">
        {{enterpriseItem.name}}
      </div> 
      <div class="content">
          {{enterpriseItem.summary}}
      </div> 
     </div> 
     <div class="tag"> 
        {{enterpriseItem.coordinate}}
     </div> 
     <div class="btns"> 
      <a class="sui-btn btn-home" href="~/assets/recruit-company.html" target="_blank">企业主页</a> 
      <a class="sui-btn btn-position" href="~/assets/recruit-job.html" target="_blank">1个职位</a> 
     </div> 
    </div> 
   </div> 
  </div> 

    </div>
</template>

<script>
import "~/assets/css/page-sj-recruit-detail.css"
import recruitApi from "~/api/recruit"
import enterpriseApi from "~/api/enterprise"
export default {
    asyncData({params}) { //params,动态路由中的参数，id参数的名称：id
        //后台查询数据（异步获取数据）
        //根据id查询招聘详情
        return recruitApi.findById(params.id).then(res => {
            //res中具有一个企业id的属性
            //根据id查询企业
            return enterpriseApi.findById(res.data.data.eid).then( res1 => {
                return {
                    item:  res.data.data , //招聘信息详情
                    enterpriseItem: res1.data.data //企业对象
                }
            })

        })
    }
}
</script>

<style>

</style>
